package kr.hkit.powerjava.chapter06;

public class gugudanFor {
	public static void main(String[] args) {
/*
		for(int i=1; i<10; i++) {
			System.out.printf("%2d * %2d = %2d\n", 2, i, 2*i);
		}
		*/
		//calFact(5);
		prnStar();
		//calGuGuDan(5);
	}

	private static void calGuGuDan(int dan) {
		for(int i=1; i<10; i++) {
			if(i==5) continue;
			System.out.printf("%2d * %2d = %2d\n", dan, i, dan*i);
		}
		System.out.println();
	}

	private static void prnStar() {
		for(int i=6; i>0; i--) {
			for(int j=0; j<i-1; j++){
				System.out.print(" ");
			}
			for(int j=i; j<6; j++) {
				System.out.print('*');
			}
			System.out.println();
		}
		/*for(int j=1; j<=5; j++) {
			for(int i=4; i>=j; i--) {
				System.out.print(" ");
			}
			for(int k=1; k<=j; k++){
				System.out.print("*");
			}
			System.out.println();
		}
		*/
	}

	private static void calFact(int i) {
		int fact = 1;
		
		for(int j=1; j<i+1; j++) {
			fact = fact * j;
			
		}
		System.out.println(i + "! = " + fact );
		
	}
}
